package cn.twh.wall.boot;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

import cn.twh.wall.BeetlHandle;
import cn.twh.wall.util.RandomUtil;
import cn.twh.wall.util.SnowFlake;

@Component
public class BootStartListener implements ApplicationRunner {
	@Autowired
	private BeetlHandle beetlHandle;
	@Autowired
	private SnowFlake snowFlake;

	@Override
	public void run(ApplicationArguments args) throws Exception {
		beetlHandle.init();
		snowFlake.init();
		
		beetlHandle.getGroupTemplate().registerFunctionPackage("wallUtil", RandomUtil.class);
	}
}
